using System; 
using System.Text; 
using System.Data;
using System.Data.SqlClient;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration; 
using System.Xml; 
using System.Xml.Serialization;
using SubSonic; 
using SubSonic.Utilities;

namespace Commerce.Common
{
	#region Tables Struct
	public partial struct Tables
	{
		
		public static string CategoryLog = @"CategoryLog";
        
		public static string ContentGroup = @"CSK_Content_Group";
        
		public static string ContentText = @"CSK_Content_Text";
        
		public static string Coupon = @"CSK_Coupons";
        
		public static string CouponType = @"CSK_CouponTypes";
        
		public static string MessagingMailer = @"CSK_Messaging_Mailer";
        
		public static string Promo = @"CSK_Promo";
        
		public static string PromoBundle = @"CSK_Promo_Bundle";
        
		public static string PromoCampaign = @"CSK_Promo_Campaign";
        
		public static string PromoProductBundleMap = @"CSK_Promo_Product_Bundle_Map";
        
		public static string PromoProductCrossSellMap = @"CSK_Promo_Product_CrossSell_Map";
        
		public static string PromoProductPromoMap = @"CSK_Promo_Product_Promo_Map";
        
		public static string ShippingRate = @"CSK_Shipping_Rate";
        
		public static string StatsBehavior = @"CSK_Stats_Behavior";
        
		public static string StatsTracker = @"CSK_Stats_Tracker";
        
		public static string Ad = @"CSK_Store_Ad";
        
		public static string AdText = @"CSK_Store_Ad_Text";
        
		public static string Address = @"CSK_Store_Address";
        
		public static string Attribute = @"CSK_Store_Attribute";
        
		public static string AttributeTemplate = @"CSK_Store_AttributeTemplate";
        
		public static string AttributeTypes = @"CSK_Store_AttributeType";
        
		public static string Category = @"CSK_Store_Category";
        
		public static string Image = @"CSK_Store_Image";
        
		public static string Manufacturer = @"CSK_Store_Manufacturer";
        
		public static string Order = @"CSK_Store_Order";
        
		public static string OrderItem = @"CSK_Store_OrderItem";
        
		public static string OrderNote = @"CSK_Store_OrderNote";
        
		public static string OrderStatuss = @"CSK_Store_OrderStatus";
        
		public static string Product = @"CSK_Store_Product";
        
		public static string ProductCategoryMap = @"CSK_Store_Product_Category_Map";
        
		public static string ProductDescriptor = @"CSK_Store_ProductDescriptor";
        
		public static string ProductRating = @"CSK_Store_ProductRating";
        
		public static string ProductReview = @"CSK_Store_ProductReview";
        
		public static string ProductReviewFeedback = @"CSK_Store_ProductReviewFeedback";
        
		public static string ProductStatuss = @"CSK_Store_ProductStatus";
        
		public static string ProductTypes = @"CSK_Store_ProductType";
        
		public static string ShippingEstimates = @"CSK_Store_ShippingEstimate";
        
		public static string ShippingTypes = @"CSK_Store_ShippingType";
        
		public static string Transaction = @"CSK_Store_Transaction";
        
		public static string TransactionTypes = @"CSK_Store_TransactionType";
        
		public static string TaxRate = @"CSK_Tax_Rate";
        
		public static string TaxType = @"CSK_Tax_Type";
        
		public static string UtilCountry = @"CSK_Util_Country";
        
		public static string UtilCurrency = @"CSK_Util_Currency";
        
		public static string UtilZipCode = @"CSK_Util_ZipCode";
        
		public static string Log = @"Log";
        
	}

	#endregion
    #region View Struct
    public partial struct Views 
    {
		
		public static string ProductCrossSell = @"ProductCrossSells";
        
		public static string VCoupon = @"vCoupons";
        
		public static string VwProduct = @"vwProduct";
        
    }

    #endregion
    
    #region Query Factories
	public static partial class DB
	{
	    public static Select SelectAllColumnsFrom<T>() where T : RecordBase<T>, new()
	    {
	        return SubSonic.Select.AllColumnsFrom<T>();
	    }

	        
	    public static Select Select()
	    {
	        return new Select(DataService.Providers["dashCommerce"]);
	    }

	    
		public static Select Select(params string[] columns)
		{
	        return new Select(DataService.Providers["dashCommerce"], "dashCommerce");
	    }

	    
		public static Select Select(params Aggregate[] aggregates)
		{
	        return new Select(DataService.Providers["dashCommerce"], aggregates);
	    }

   
	    public static Update Update<T>() where T : ActiveRecord<T>, new()
	    {
	        return new SubSonic.Update(new T().GetSchema());
	    }
     
	    
	    public static Insert Insert()
	    {
	        Insert i=new Insert();
	        i.provider = DataService.Providers["dashCommerce"];
	        return i;
	    }

	    
	    public static Delete Delete()
	    {
	        return new Delete("dashCommerce");
	    }

	    
	    public static InlineQuery Query()
	    {
   	        return new InlineQuery("dashCommerce");
	    }

	    
	    
	}

    #endregion
    
}

#region Databases
public partial struct Databases 
{
	
	public static string dashCommerce = @"dashCommerce";
    
}

#endregion